<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <base href="#(basePath)"/>
  <title>商户管理 - 商户列表</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="static/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="static/admin.css" media="all">
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-card">
      <div class="layui-form layui-card-header layuiadmin-card-header-auto">
        <div class="layui-form-item">
          <div class="layui-inline">
            <label class="layui-form-label">用户名称</label>
            <div class="layui-input-inline">
              <input type="text" name="name" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">用户编号</label>
            <div class="layui-input-inline">
              <input type="text" name="code" placeholder="请输入" autocomplete="off" class="layui-input">
            </div>
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">状态</label>
            <div class="layui-input-inline">
              <select name="enable">
                <option value="">请选择</option>
                <option value="1">启用</option>
                <option value="0">禁用</option>
              </select>
            </div>
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">实名认证</label>
            <div class="layui-input-inline">
              <select name="isVerify">
                <option value="">请选择</option>
                <option value="1">已认证</option>
                <option value="0">未认证</option>
              </select>
            </div>
          </div>
          <div class="layui-inline">
            <label class="layui-form-label">合同签署</label>
            <div class="layui-input-inline">
              <select name="isSign">
                <option value="">请选择</option>
                <option value="1">已签署</option>
                <option value="0">未签署</option>
              </select>
            </div>
          </div>
          <div class="layui-inline">
            <button class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="LAY-web-list-search">
              <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
            </button>
            #auth()
            <button link="admin/merch/addPage" class="layui-btn layuiadmin-btn-list" data-type="add">添加</button>
            #end
          </div>
        </div>
      </div>

      <div class="layui-card-body">
        <table id="LAY-web-list" lay-filter="LAY-web-list"></table>
        <script type="text/html" id="table-content-list">
          #auth()
          <a link="admin/merch/updatePage" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="update"><i class="layui-icon layui-icon-edit"></i>编辑</a>
          #end

          #auth()
          <a link="admin/merch/view" class="layui-btn layui-btn-normal layui-btn-xs" lay-event="view"><i class="layui-icon layui-icon-edit"></i>详情</a>
          #end
        </script>
      </div>


    </div>
  </div>

  <script src="static/layui/layui.js"></script>
  <script>
  layui.config({
    base: '#(basePath)' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'table', 'merch'], function(){
    // 表格
    var table = layui.table
    ,form = layui.form;

    //监听搜索
    form.on('submit(LAY-web-list-search)', function(data){
      var field = data.field;

      //执行重载
      table.reload('LAY-web-list', {
        where: field,
        page: {curr: 1}
      });
    });

    var $ = layui.$,
    active = {
      add: function(){
  		parent.layer.open({
          type: 2
          ,title: '添加'
          ,content: 'admin/merch/addPage'
          ,maxmin: true
          ,area: ['80%', '90%']
          ,btn: ['确定', '取消']
          ,yes: function(index, layero){
             //点击确认触发 iframe 内容中的按钮提交
             layero.find('iframe').contents().find("#layuiadmin-app-form-submit").click();
           }
        });
      }
    };

    $('.layui-btn.layuiadmin-btn-list').on('click', function(){
      var type = $(this).data('type');
      active[type] ? active[type].call(this) : '';
    });

  });
  </script>
</body>
</html>
